<script type="text/javascript">
var secends = window.opener ? 3 : 10;
function _timer() {
	if(window.opener) {
		try {
			window.opener.location.reload();
			setTimeout(function(){
				secends--;
				$('#timer').text(secends.toString());
				if(secends == 0) {
					window.close();
				} else {
					_timer();
				}
			}, 1000);
		} catch (e) {}
		return false;
	}	
	setTimeout(function(){
		secends--;
		$('#timer').text(secends.toString());
		if(secends == 0) {
			var referer = '<?php echo $this->referer;?>';
			if(referer == '') referer = $('.guide').find('a').first().attr('href');
			window.location = referer;
		} else {
			_timer();
		}
	}, 1000);
}
if(window.addEventListener){
	window.addEventListener('load', function() {$('#timer').text(secends);_timer();}, false);
}else{
	window.attachEvent('onload', function() {$('#timer').text(secends);_timer();});
}
</script>
<div class="body">
	<div class="msg">
		<div class="common ok">
			<i class="icon"></i><h4>MESSAGE:</h4>
			<div class="msg-bd">
				<?php echo $this->language($this->throwMessage);?>!<br/>
				<span id="msg">System will redirect to last page</span> automaticall within <strong id="timer">10</strong> seconds.<br/>
				Or you can select another page you want to visit.<br/><br/>
				<ul class="guide">
					<?php if($this->referer) { ?>
					<li><a href="<?php echo $this->referer;?>"><?php echo $this->referer;?></a></li>
					<?php } ?>
					<?php foreach(system_nav_crumbs::getInstance()->getPages() AS $page) {?>
					<li><a href="<?php echo $page->href();?>"><?php echo $this->escape($page->getLabel());?> »</a></li>
					<?php } ?>
				</ul>
				<br/>
			</div>
		</div>
	</div>
</div>
